#ifndef MAIN_H
#define MAIN_H
#include <websocketpp/config/asio.hpp>

#include <websocketpp/server.hpp>

#include <jsoncpp/json/json.h>

#include <iostream>

#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <sstream>
#include <iomanip>
#include <chrono>
#include <random>


//客户端发送命令类型
enum ClientReq{
    CREATE,
    PLAYERSET,
    JOIN,
    READY,
    UNREADY,
    GO,
    RETURN,
    NEXTROUND,
    EXIT,
    TEST,
    VERSION,
    GETLOBBY
};

//服务端发送命令
enum ServerRtn{
    ROOMINF,
    GAMESTART,
    GAMEINF
};

//客户端发送json实例
/*
[
    {
        "uid":"xxxxxxxxxxxxxxxxxxxxx"
    },
    {
        "type":1,
        "set":{
            "xx":"xx"
            "xx":xx
        }
    },
    {
        "type":2,
        "roomid":{
            "xx":"xx"
            "xx":xx
        }
    },
]
*/

// 服务端反馈json实例
/*
{
    "type":2//callback,xx_notify...
    ""
}
*/

typedef websocketpp::server<websocketpp::config::asio_tls> server;
using namespace std;

typedef enum{
    SUCCESS = 1,
    WRONG_STATE_PLAYER = 0,
    WRONG_STATE_GAME = -1,
    WRONG_ARG = -2,
    FULL = -3

}ErrorType;


#endif